<%@ page language="java"  pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="/struts-dojo-tags" prefix="sx"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="<s:url value="/style.css"/>" rel="stylesheet" type="text/css"/>
<title>Visitation Statistics</title>
<style>
	#infoLeft {
		display:inline-block;
		width:100px;
		alignX:center;
		margin-right:30px;
	}
	#infoRight {
		display:inline-block;
		alignX:center;
	}
	#paitentInfo {
		align:left;
	}
	h3 {
		alignX:left;
	}
	#visitationTable td {
		text-align:center;
	}
	
</style>
<sx:head/>
</head>
<body>
	<jsp:include page="/navigation/navigation.jsp"/>
	<div id="mainBox">
	<div>
	<center>
			<s:form name="searchVisitationByDrugForm" action="searchAppointmentByDoctorAndTimePeriod" method="post">
				<table>
					<tr>
						<td>Search By Doctor and Time Period</td>
						<td><sx:datetimepicker name="startDate" label="Start Date"
								displayFormat="yyyy-MM-dd" /></td>
						<td><sx:datetimepicker name="endDate" label="End Date"
								displayFormat="yyyy-MM-dd" /></td>
						<td><select name="searchDoctorId">
									<option value="-1">--</option>
									<s:iterator value="#session.doctorList">
										<option value="<s:property value="id"/>"
												<s:if test="id==key">selected = "selected"</s:if>>
												<s:property value="name" />
										</option>
									</s:iterator>
						</select></td>
								
						<td><input type="submit" value="Search" /></td>
					</tr>
				</table>
			</s:form>
		</center>
	</div>
	<div>
	<table align="center">
	<s:if test="displayStartDate!=null && displayEndDate!=null" ></s:if>
		<tr>
			<td>The number of patients visited 
			by
			<s:property value ="#session.searchByDoctorName"/>
			during
			<s:property value ="displayStartDate"/>
			to
			<s:property value ="displayEndDate"/>
			is
			<s:property value ="patientCount"/></td>
		</tr>	
	</table>
	<table border="1" align="center" >
	<col width="200" />
	<col width="200" />
	<thead>
		<tr>
		  <th>Patient Id</th>
		  <th>Times of Visitation</th>
		</tr>
	</thead>
		<s:iterator value ="patientStatMap">
		<tr>
		<td><a href="<s:url action='searchAppointmentByPatientAndTimePeriod'><s:param name="patientId" value="key.id" /></s:url>"><s:property value="key.id"/></a></td>
		<td><s:property value="value"/></td>
		</tr>
		</s:iterator>	
	</table>
	</div>
	
	
	</div>
</body>
</html>